<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>template</title>
    <style>
        body{
            font-size: 30px;
        }
        td,th{
            border: 2px solid #ccc;
        }
    </style>
</head>
<body>
<div id="app">

</div>
<script src="dist/template.js"></script>
<script>
    var test = '  123  ';
    var reg = /^\s*|\s*$/g;
    console.log("|"+test.replace(reg,'')+"|");
</script>
</body>
</html>